package pattern.prototype.depp_clone;

public class Test {
    public static void main(String[] args) throws Exception {
        Student stu1 = new Student("张三", "男", 18);
        Clazz clazz1 = new Clazz("一班", stu1);
        System.out.println(clazz1);
        Clazz clazz2 = (Clazz) clazz1.deepClone();
        Student stu2 = clazz2.getStudent();
        stu2.setName("李四");
        System.out.println(clazz1);
        System.out.println(clazz2);
    }
}
